Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[podresapi 3/3] topology-aware: use Pod Resource API hints if present. #420

Merged

Conversation

klihub
Copy link
Collaborator

@klihub klihub commented Dec 1, 2024

This patch series adds handling for extra topology hints acquired from the kubelet's Pod Resource API. If any such hints are found, they are fully resolved (from NUMA-only hints to cpuset-specific ones), before taken into account.

@klihub klihub force-pushed the devel/topology-aware/use-podresapi-hints branch 2 times, most recently from 603159e to 544f53e Compare December 1, 2024 17:53
@klihub klihub changed the title [Pod Resource API 3/3] topology-aware: use Pod Resource API-based hints if present. [podresapi 3/3] topology-aware: use Pod Resource API-based hints if present. Dec 1, 2024
@klihub klihub force-pushed the devel/topology-aware/use-podresapi-hints branch from 544f53e to 5fb185a Compare December 2, 2024 08:12
@klihub klihub changed the title [podresapi 3/3] topology-aware: use Pod Resource API-based hints if present. [podresapi 3/3] topology-aware: use Pod Resource API hints if present. Dec 2, 2024
@klihub
Copy link
Collaborator Author

klihub commented Dec 2, 2024

/cc @pfl

@klihub klihub marked this pull request as draft December 2, 2024 09:42
@klihub klihub force-pushed the devel/topology-aware/use-podresapi-hints branch from 5fb185a to d539ff4 Compare December 2, 2024 11:47
@klihub klihub marked this pull request as ready for review December 2, 2024 11:48
@klihub klihub force-pushed the devel/topology-aware/use-podresapi-hints branch 2 times, most recently from 494fdd3 to 72bfdfc Compare December 3, 2024 09:09
docs/resource-policy/policy/topology-aware.md Outdated Show resolved Hide resolved
pkg/agent/agent.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@fmuyassarov fmuyassarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since NodeResourceTopology can be disabled as well, should we extend this line to check if the NodeResourceTopology=true?

pkg/agent/pod-resource-api.go Outdated Show resolved Hide resolved
pkg/agent/pod-resource-api.go Outdated Show resolved Hide resolved
@klihub klihub force-pushed the devel/topology-aware/use-podresapi-hints branch from 72bfdfc to 33810b8 Compare December 3, 2024 15:22
Add configuration for the agent itself. Currently the
only control enables access to Node Resource Topology
Custom Resources and it is on by default. Update the
agent to honor its configuration.

Signed-off-by: Krisztian Litkey <[email protected]>
Add support for tapping into the kubelet's pod resource
API to query extra information about resources assigned
to pods and containers. Use such a new client to expose
agent functions for listing and querying pod resources,
both synchronously and asynchronously.

Signed-off-by: Krisztian Litkey <[email protected]>
Try querying Pod Resource API and generate extra topology
hints using container device assignments listed there.

Signed-off-by: Krisztian Litkey <[email protected]>
Bind-mount kubelet pod-resources directory read-only to plugin
daemonset, to provide access to kubelet pod-resources socket.

Signed-off-by: Krisztian Litkey <[email protected]>
Add functions for resolving partial, NUMA-only topology
hints to fully defined CPU-specific ones using a sysfs
instance.

Signed-off-by: Krisztian Litkey <[email protected]>
Resolve potential partial NUMA-only topology hints to full
CPU hints.

Signed-off-by: Krisztian Litkey <[email protected]>
Update docs with a brief mention of how to enable topology hints
based on Pod Resource API queries. Make mock tests compile again.

Signed-off-by: Krisztian Litkey <[email protected]>
@klihub klihub force-pushed the devel/topology-aware/use-podresapi-hints branch from 33810b8 to d05b4e1 Compare December 3, 2024 15:24
@klihub
Copy link
Collaborator Author

klihub commented Dec 3, 2024

Since NodeResourceTopology can be disabled as well, should we extend this line to check if the NodeResourceTopology=true?

Let's leave that for another PR. There are a few other similar things we could then take care of in the same PR, for instance not updating policy metrics if their collection is not enabled.

@klihub klihub requested a review from kad December 3, 2024 15:37
Copy link
Collaborator

@kad kad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kad kad merged commit 331b1ec into containers:main Dec 4, 2024
4 checks passed
@klihub klihub deleted the devel/topology-aware/use-podresapi-hints branch December 4, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants